import Vue from 'vue'
import Vuex from 'vuex'

import modules from './modules'

Vue.use(Vuex)

const debug = process.env.NODE_ENV !== 'production'

const getters = {
  isIos: () => {
    return !!window.navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
  }
}

const store = new Vuex.Store({
  modules,
  getters,
  strict: debug
})

export default store
